{	Problem: http://codeforces.ru/problemset/problem/88/A
 	Verdict: Accepted
}
uses SysUtils, Math;

const 
    n:array[1..12] of string=('C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'B', 'H');

var 
    i:longint;
    s,a,b,c,t:string;

procedure swap(var a,b:string);
var
    t:string;
begin
t:=a;
a:=b;
b:=t;
end;

function check(a,b,c:string):longint;
var
    i,ia,ib,ic:longint;
begin
result:=0;
for i:=1 to 12 do
    if n[i]=a then begin
        ia:=i;
        break;
    end;
i:=i mod 12+1;
ib:=1;
while b<>n[i] do begin
    inc(ib);
    i:=i mod 12+1;
end;
i:=i mod 12+1;
ic:=1;
while c<>n[i] do begin
    inc(ic);
    i:=i mod 12+1;
end;
if (ib=4) and (ic=3) then begin
    write('major');
    result:=1;
end else
if (ib=3) and (ic=4) then begin
    result:=2;
    write('minor');
end;
end;
    
begin
readln(s);
a:=copy(s,1,pos(' ',s)-1);
delete(s,1,pos(' ',s));
b:=copy(s,1,pos(' ',s)-1);
delete(s,1,pos(' ',s));
c:=s;
if check(a,b,c)=0 then
    if check(a,c,b)=0 then
        if check(b,a,c)=0 then
            if check(b,c,a)=0 then  
                if check(c,a,b)=0 then
                    if check(c,b,a)=0 then write('strange');    
end.